﻿CREATE PROCEDURE [dbo].[yaf_nntpserver_save](
                @NntpServerID INT  = NULL,
                @BoardID      INT,
                @Name         NVARCHAR(50),
                @Address      NVARCHAR(100),
                @Port         INT,
                @UserName     NVARCHAR(50)  = NULL,
                @UserPass     NVARCHAR(50)  = NULL)
AS
    BEGIN
        IF @NntpServerID IS NULL
        INSERT INTO yaf_NntpServer
                   (Name,
                    BoardID,
                    Address,
                    Port,
                    UserName,
                    UserPass)
        VALUES     (@Name,
                    @BoardID,
                    @Address,
                    @Port,
                    @UserName,
                    @UserPass)
        ELSE
        UPDATE yaf_NntpServer
        SET    Name = @Name,
               Address = @Address,
               Port = @Port,
               UserName = @UserName,
               UserPass = @UserPass
        WHERE  NntpServerID = @NntpServerID
    END


